package kr.hkit.powerjava.chapter20;

public class StringBilderEx {
	public static void main(String[] args) {
		StringBuilder sb = new StringBuilder();
		sb.append("Hello");
		System.out.println(sb);
		// sb.append(sb.toString());

		sb.append("Java");

		System.out.println(sb.toString());

		char ch = sb.charAt(1);
		System.out.println(ch);

		// sb.delete(5, 8);
		// System.out.println(sb);

		System.out.println("J의 위치" + sb.indexOf("J"));

		sb.insert(5, ' ');
		System.out.println(sb + " " + sb.length());

		sb.replace(6, 10, "Android");
		System.out.println(sb);

		StringBuilder jumin = new StringBuilder("123456-1234567");
		jumin.replace(7, jumin.length(), "*******");
		System.out.println(jumin);

//		System.out.println(sb.reverse());
		sb.setCharAt(5, '*');
		System.out.println(sb);
		
		sb.setCharAt(5, ' ');
		
		String srt = sb.substring(6);
		System.out.println(srt);
		
		srt = sb.substring(6, 9);
		System.out.println(srt);
		
	}
}
